<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>graphics_entitiesnew graphics figure_style old_style </title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab Data type</center>
    <div align="right">Last update : 13/12/2005</div>
    <p>
      <b>graphics_entities</b> - description of the graphics
  entities data structures</p>
    <p>
      <b>new graphics </b> - description of the graphics entities
  data structures</p>
    <p>
      <b>figure_style </b> - description of the graphics entities
  data structures</p>
    <p>
      <b>old_style </b> - description of the graphics entities
  data structures</p>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>Scilab graphics is based on two differents modes. In the
    <tt>
        <b>"old"</b>
      </tt> mode, the graphics functions are stored to enable
    redisplay, zoom and rotations. In the <tt>
        <b>"new"</b>
      </tt> mode, each
    graphics window and the drawing it contains are represented by hierchical
    entities. The hierachy top level is the Figure. Each Figure defines at
    least one child of type Axes. Each Axes entity contains a set of leaf
    entities which are the basic graphics objects like Polylines, Rectangles,
    Arcs, Segs,... It can also contain an Compound type which are recursive
    sets of entities. The main interest of the new graphic mode is to make
    property change easier. This new graphics'mode provides a set of
    high-level graphing routines (see <a href="set.htm">
        <tt>
          <b>set</b>
        </tt>
      </a>, <a href="get.htm">
        <tt>
          <b>get</b>
        </tt>
      </a>) used
    to control objects' properties such as data, coordinates and scaling,
    color and appearences without requiring to replay the initial graphics
    commands.</p>
    <p>Graphics entities are associated to Scilab variables of type
    <tt>
        <b>handle</b>
      </tt>. The handle is a unique identifier which is associated
    to each instance of a created graphical entity. Using this handle, it will
    be possible to reach entities' properties through "set" and "get"
    routines. The handles are also used to manipulate graphics objects, to
    move them, to make copies or delete them.</p>
    <p></p>
    <p>To set the current graphics window mode we can use these following
    instructions: <tt>
        <b>set("figure_style","new") </b>
      </tt> to have a graphics
    window under the "new" mode or <tt>
        <b>set("figure_style","old ")</b>
      </tt> for
    the "old" mode.</p>
    <p>The instructions <tt>
        <b>set("old_style","off")</b>
      </tt> and
    <tt>
        <b>set("old_style","on")</b>
      </tt> are used to set the default mode to be
    used when a new graphics window is created.</p>
    <p></p>
    <dl>
      <dd>
        <b>Figure: </b>The figure entity is the top level of the graphics entities
        hierarchy. This entity defines the parameters for the figure itself as
        well as the parameters' default values for the children creation. The
        figure children are the Axes entities.<p>The handle on the current figure (the figure used where the drawing
        are sent) may be got using <tt>
            <b>get("current_figure")</b>
          </tt> and it
        may be set using <tt>
            <b>set("current_figure",h)</b>
          </tt>, where
        <tt>
            <b>h</b>
          </tt> is either a handle on a figure or a
        <tt>
            <b>figure_id</b>
          </tt> in this last case if the figure does not
        already exists , it is created</p>
        <p>See <a href="figure_properties.htm">
            <tt>
              <b>figure_properties</b>
            </tt>
          </a> for details.</p>
        <dl>
          <dd>
            <b></b>
          </dd>
        </dl>
      </dd>
      <dd>
        <b>Axes: </b>
        <p>The Axes entity is the second level of the graphics entities
        hierarchy. This entity defines the parameters for the change of
        coordinates and the axes drawing as well as the parameters' default
        values for its children creation. See <a href="axes_properties.htm">
            <tt>
              <b>axes_properties</b>
            </tt>
          </a> for
        details. The handle on the current Axes may be got using
        <tt>
            <b>get("current_axes")</b>
          </tt>.</p>
        <dl>
          <dd>
            <b></b>
          </dd>
        </dl>
      </dd>
      <dd>
        <b>Compound: </b>The Compound entity is just a vector of children and with a single
        property (visibility property). It is used to glue a set of entities
        together.<p>See <a href="glue.htm">
            <tt>
              <b>glue</b>
            </tt>
          </a>, <a href="unglue.htm">
            <tt>
              <b>unglue</b>
            </tt>
          </a> and
        <a href="compound_properties.htm">
            <tt>
              <b>Compound_properties</b>
            </tt>
          </a> functions.</p>
        <dl>
          <dd>
            <b></b>
          </dd>
        </dl>
      </dd>
      <dd>
        <b>Axis: </b>The Axis entity is a leaf of the graphics entities hierarchy. This
        entity defines the parameters for axis scaling and appearance.<p>See <a href="axis_properties.htm">
            <tt>
              <b>axis_properties</b>
            </tt>
          </a> for details.</p>
        <dl>
          <dd>
            <b></b>
          </dd>
        </dl>
      </dd>
      <dd>
        <b>Polyline: </b>The polyline entity is a leaf of the graphics entities hierarchy.
        It defines 2D and 3D polylines and polylines extensions drawing
        properties.<p>See <a href="polyline_properties.htm">
            <tt>
              <b>polyline_properties</b>
            </tt>
          </a> for details.</p>
        <dl>
          <dd>
            <b></b>
          </dd>
        </dl>
      </dd>
      <dd>
        <b>Arc: </b>The Arc entity is a leaf of the graphics entities hierarchy. This
        entity defines the parameters for ellipses and part of ellipses.<p>See <a href="arc_properties.htm">
            <tt>
              <b>arc_properties</b>
            </tt>
          </a> for details.</p>
        <dl>
          <dd>
            <b></b>
          </dd>
        </dl>
      </dd>
      <dd>
        <b>Rectangle: </b>The Rectangle entity is a leaf of the graphics entities hierarchy.
        This entity defines the parameters for rectangles and filled
        rectangles.<p>See <a href="rectangle_properties.htm">
            <tt>
              <b>rectangle_properties</b>
            </tt>
          </a> for details.</p>
        <dl>
          <dd>
            <b></b>
          </dd>
        </dl>
      </dd>
      <dd>
        <b>Surface: </b>The Surface entity is a leaf of the graphics entities hierarchy.
        It has sub types <tt>
          <b>Fac3d</b>
        </tt> or <tt>
          <b>Plot3d</b>
        </tt>. This
        entity defines the parameters for 3d surface plots.<p>See <a href="surface_properties.htm">
            <tt>
              <b>surface_properties</b>
            </tt>
          </a> for details.</p>
        <dl>
          <dd>
            <b></b>
          </dd>
        </dl>
      </dd>
      <dd>
        <b>Fec: </b>The Fec entity is a leaf of the graphics entities hierarchy. It
        represents 2D finite elements plots .<p>See <a href="fec_properties.htm">
            <tt>
              <b>fec_properties</b>
            </tt>
          </a> for details.</p>
        <dl>
          <dd>
            <b></b>
          </dd>
        </dl>
      </dd>
      <dd>
        <b>Grayplot: </b>The Grayplot entity is a leaf of the graphics entities hierarchy.
        It represents 2D plots of surface using colors and images.<p>See <a href="grayplot_properties.htm">
            <tt>
              <b>grayplot_properties</b>
            </tt>
          </a> for details.</p>
        <dl>
          <dd>
            <b></b>
          </dd>
        </dl>
      </dd>
      <dd>
        <b>Matplot: </b>The Matplot entity is a leaf of the graphics entities hierarchy.
        It represents 2D plots using integer matrices.<p>See <a href="Matplot_properties.htm">
            <tt>
              <b>Matplot_properties</b>
            </tt>
          </a> for details.</p>
        <dl>
          <dd>
            <b></b>
          </dd>
        </dl>
      </dd>
      <dd>
        <b>Segs: </b>The Segs entity is a leaf of the graphics entities hierarchy. This
        entity defines the parameters for a set of colored segments or colored
        arrows.<p>See <a href="segs_properties.htm">
            <tt>
              <b>segs_properties</b>
            </tt>
          </a> for details.</p>
        <dl>
          <dd>
            <b></b>
          </dd>
        </dl>
      </dd>
      <dd>
        <b>Champ: </b>The Champ entity is a leaf of the graphics entities hierarchy.
        This entity defines the parameters for a 2D vector field.<p>See <a href="champ_properties.htm">
            <tt>
              <b>champ_properties</b>
            </tt>
          </a> for details.</p>
        <dl>
          <dd>
            <b></b>
          </dd>
        </dl>
      </dd>
      <dd>
        <b>Text: </b>The Text entity is a leaf of the graphics entities hierarchy. This
        entity defines the parameters for string drawing.<p>See <a href="text_properties.htm">
            <tt>
              <b>text_properties</b>
            </tt>
          </a> for details.</p>
        <dl>
          <dd>
            <b></b>
          </dd>
        </dl>
      </dd>
      <dd>
        <b>Label: </b>The Labels entity are children of the <tt>
          <b>Axes</b>
        </tt> graphics
        entity. This entity defines the parameters for the 3 x,y and z labels
        and title drawn on a graphics window.<p>See <a href="label_properties.htm">
            <tt>
              <b>label_properties</b>
            </tt>
          </a> for details.</p>
        <dl>
          <dd>
            <b></b>
          </dd>
        </dl>
      </dd>
      <dd>
        <b>Legend: </b>The Legend entity is a leaf of the graphics entities hierarchy.
        This entity defines the parameters for legends drawn below
        <tt>
          <b>plot2dx</b>
        </tt> graphs. This entity requires further
        developments.<p>See <a href="legend_properties.htm">
            <tt>
              <b>legend_properties</b>
            </tt>
          </a> for details.</p>
        <dl>
          <dd>
            <b></b>
          </dd>
        </dl>
      </dd>
    </dl>
    <h3>
      <font color="blue">Examples</font>
    </h3>
    <pre>


  //Play this example line per line

  set("figure_style","new") //create a figure in entity mode

  //get the handle on the Figure entity and display its properties
  f=get("current_figure") 
  a=f.children // the handle on the Axes child
  x=(1:10)';  plot2d(x,[x.^2 x.^1.5])
  e=a.children //Compound of 2 polylines

  p1=e.children(1) //the last drawn polyline properties
  p1.foreground=5;  // change the polyline color
  e.children.thickness=5; // change the thickness of the two polylines

  delete(e.children(2))

  move(e.children,[0,30]) //translate the polyline

  a.axes_bounds=[0 0 0.5 0.5]; 

  subplot(222) //create a new Axes entity
  plot(1:10);
  a1=f.children(1); //get its handle
  copy(e.children,a1); //copy the polyline of the first plot in the new Axes
  a1.data_bounds=[1 0;10 100]; //change the Axes bounds  

  set("current_figure",10) //create a new figure with figure_id=10
  plot3d() //the drawing are sent to figure 10
  set("current_figure",f) //make the previous figure the current one
  plot2d(x,x^3)  //the drawing are sent to the initial figure

 
  </pre>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="set.htm">
        <tt>
          <b>set</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="get.htm">
        <tt>
          <b>get</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="move.htm">
        <tt>
          <b>move</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="draw.htm">
        <tt>
          <b>draw</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="delete.htm">
        <tt>
          <b>delete</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="object_editor.htm">
        <tt>
          <b>object_editor</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="plot.htm">
        <tt>
          <b>plot</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="surf.htm">
        <tt>
          <b>surf</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
  </body>
</html>
